package com.spsy.prod.service.impl;

import java.util.List;
import com.spsy.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.spsy.prod.mapper.TbOrderRecordMapper;
import com.spsy.prod.domain.TbOrderRecord;
import com.spsy.prod.service.ITbOrderRecordService;

/**
 * 订单记录Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-31
 */
@Service
public class TbOrderRecordServiceImpl implements ITbOrderRecordService 
{
    @Autowired
    private TbOrderRecordMapper tbOrderRecordMapper;

    /**
     * 查询订单记录
     * 
     * @param recordId 订单记录主键
     * @return 订单记录
     */
    @Override
    public TbOrderRecord selectTbOrderRecordByRecordId(Long recordId)
    {
        return tbOrderRecordMapper.selectTbOrderRecordByRecordId(recordId);
    }

    /**
     * 查询订单记录列表
     * 
     * @param tbOrderRecord 订单记录
     * @return 订单记录
     */
    @Override
    public List<TbOrderRecord> selectTbOrderRecordList(TbOrderRecord tbOrderRecord)
    {
        return tbOrderRecordMapper.selectTbOrderRecordList(tbOrderRecord);
    }

    /**
     * 新增订单记录
     * 
     * @param tbOrderRecord 订单记录
     * @return 结果
     */
    @Override
    public int insertTbOrderRecord(TbOrderRecord tbOrderRecord)
    {
        tbOrderRecord.setCreateTime(DateUtils.getNowDate());
        return tbOrderRecordMapper.insertTbOrderRecord(tbOrderRecord);
    }

    /**
     * 修改订单记录
     * 
     * @param tbOrderRecord 订单记录
     * @return 结果
     */
    @Override
    public int updateTbOrderRecord(TbOrderRecord tbOrderRecord)
    {
        tbOrderRecord.setUpdateTime(DateUtils.getNowDate());
        return tbOrderRecordMapper.updateTbOrderRecord(tbOrderRecord);
    }

    /**
     * 批量删除订单记录
     * 
     * @param recordIds 需要删除的订单记录主键
     * @return 结果
     */
    @Override
    public int deleteTbOrderRecordByRecordIds(Long[] recordIds)
    {
        return tbOrderRecordMapper.deleteTbOrderRecordByRecordIds(recordIds);
    }

    /**
     * 删除订单记录信息
     * 
     * @param recordId 订单记录主键
     * @return 结果
     */
    @Override
    public int deleteTbOrderRecordByRecordId(Long recordId)
    {
        return tbOrderRecordMapper.deleteTbOrderRecordByRecordId(recordId);
    }
}
